From 952423a6155130f83530a7616fc9c2ceef29855c Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Tue, 12 Oct 2021 15:20:35 -0600 Subject: [PATCH] avoid std::min with QString::size missed one in previous commit. --- igo8.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/igo8.cc b/igo8.cc index 8b361a794..88cbc40cb 100644 --- a/igo8.cc +++ b/igo8.cc @@ -61,7 +61,6 @@ */ -#include #include // for SEEK_SET #include #include // for atoi @@ -70,7 +69,6 @@ #include // for QChar #include // for QString #include // for QVector -#include // for ushort #include "defs.h" #include "gbfile.h" // for gbfwrite, gbfclose, gbfseek, gbfgetint32, gbfread, gbfile, gbfopen_le @@ -261,7 +259,7 @@ static unsigned int print_unicode(char* dst, int dst_max_length, const QString& } // Write as many characters from the source as possible // while leaving space for a terminator. - int n_src_qchars = std::min(max_qchars - 1, src.size()); + int n_src_qchars = src.size() > (max_qchars - 1) ? max_qchars - 1 : src.size(); for (int i = 0; i < n_src_qchars; ++i) { le_write16(dst, src.at(i).unicode()); dst += 2; -- 2.30.2